import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        //字符串的分割
//        Scanner scanner=new Scanner(System.in);
//        String str=scanner.nextLine();
//        String[] res=str.split(" ");
//        int len=res[res.length-1].length();
//        System.out.println(len);

        //找到最后一个空格的下标截取
        Scanner scanner=new Scanner(System.in);
        String str=scanner.nextLine();
        int indext=str.lastIndexOf(" ");
        int len=str.substring(indext+1).length();
        System.out.println(len);
    }
}
